package cn.xiongxf.controller;

import cn.xiongxf.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Value("${server.port}")  // 从配置文件中获取参数
    private String port;

    /**
     * User服务接口
     * @param id
     * @return
     */
    @GetMapping("/getById/{id}")
    public User getById(@PathVariable Long id){
        return new User(id,"xiongxf","我在源码时代学SpringCloud啦！ port = " + port);
    }
}
